Skip to content

br: add status field for log status with json (#58465)#58567

Merged
ti-chi-bot[bot] merged 1 commit intopingcap:release-6.5from
ti-chi-bot:cherry-pick-58465-to-release-6.5
Feb 6, 2025
Merged

br: add status field for log status with json (#58465)#58567
ti-chi-bot[bot] merged 1 commit intopingcap:release-6.5from
ti-chi-bot:cherry-pick-58465-to-release-6.5

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #58465

What problem does this PR solve?

Issue Number: close #57959

Problem Summary:
log task status is not reported in the json format output

What changed and how does it work?

report log task status in the json format output

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
$ ./br log status --task-name pitr -u 127.0.0.1:2379
● Total 1 Tasks.
> #1 <
              name: pitr
            status: ● NORMAL
             start: 2024-12-23 14:30:34.62 +0800
               end: 2090-11-18 22:07:45.624 +0800
           storage: local:///root/backups/test9/log
       speed(est.): 0.00 ops/s
checkpoint[global]: 2024-12-23 14:30:34.62 +0800; gap=22s

$ ./br log status --task-name pitr -u 127.0.0.1:2379 --json
[{"name":"pitr","start_ts":454802914573025282,"end_ts":999999999999999999,"status":"NORMAL","table_filter":["*.*"],"progress":[],"storage":"local:///root/backups/test9/log","checkpoint":454802914573025282,"estimate_qps":0,"last_errors":[]}]
$ ./br log status --task-name pitr -u 127.0.0.1:2379
● Total 1 Tasks.
> #1 <
              name: pitr
            status: ● PAUSE
             start: 2024-12-23 14:30:34.62 +0800
               end: 2090-11-18 22:07:45.624 +0800
           storage: local:///root/backups/test9/log
       speed(est.): 0.00 ops/s
checkpoint[global]: 2024-12-23 14:33:02.07 +0800; gap=3m10s

$ ./br log status --task-name pitr -u 127.0.0.1:2379 --json
[{"name":"pitr","start_ts":454802914573025282,"end_ts":999999999999999999,"status":"PAUSE","table_filter":["*.*"],"progress":[],"storage":"local:///root/backups/test9/log","checkpoint":454802953226158082,"estimate_qps":0,"last_errors":[]}]
$ ./br log status --task-name pitr -u 127.0.0.1:2379
● Total 1 Tasks.
> #1 <
                    name: pitr
                  status: ○ ERROR
                   start: 2024-12-23 14:30:34.62 +0800
                     end: 2090-11-18 22:07:45.624 +0800
                 storage: local:///root/backups/test9/log
             speed(est.): 0.00 ops/s
      checkpoint[global]: 2024-12-23 14:33:02.07 +0800; gap=14m37s
          error[store=1]: KV:LogBackup:Io
error-happen-at[store=1]: 2024-12-23 14:46:22.055 +0800; gap=1m17s
  error-message[store=1]: I/O Error: No such file or directory (os error 2)
          error[store=2]: KV:LogBackup:Io
error-happen-at[store=2]: 2024-12-23 14:46:22.056 +0800; gap=1m17s
  error-message[store=2]: I/O Error: No such file or directory (os error 2)
          error[store=3]: KV:LogBackup:Io
error-happen-at[store=3]: 2024-12-23 14:46:22.057 +0800; gap=1m17s
  error-message[store=3]: I/O Error: No such file or directory (os error 2)

$ ./br log status --task-name pitr -u 127.0.0.1:2379 --json
[{"name":"pitr","start_ts":454802914573025282,"end_ts":999999999999999999,"status":"ERROR","table_filter":["*.*"],"progress":[],"storage":"local:///root/backups/test9/log","checkpoint":454802953226158082,"estimate_qps":0,"last_errors":[{"store_id":1,"last_error":{"happen_at":1734936382055,"error_code":"KV:LogBackup:Io","error_message":"I/O Error: No such file or directory (os error 2)","store_id":1}},{"store_id":2,"last_error":{"happen_at":1734936382056,"error_code":"KV:LogBackup:Io","error_message":"I/O Error: No such file or directory (os error 2)","store_id":2}},{"store_id":3,"last_error":{"happen_at":1734936382057,"error_code":"KV:LogBackup:Io","error_message":"I/O Error: No such file or directory (os error 2)","store_id":3}}]}]
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot added ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Dec 27, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Please upload report for BASE (release-6.5@e83dbdd). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-6.5     #58567   +/-   ##
================================================
  Coverage               ?   74.0010%           
================================================
  Files                  ?       1097           
  Lines                  ?     355584           
  Branches               ?          0           
================================================
  Hits                   ?     263136           
  Misses                 ?      75831           
  Partials               ?      16617           

@ti-chi-bot ti-chi-bot Bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Jan 21, 2025
@ti-chi-bot ti-chi-bot Bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 24, 2025
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Feb 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, Leavrth

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 6, 2025
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Feb 6, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-24 08:17:24.515715087 +0000 UTC m=+427971.846634488: ☑️ agreed by Leavrth.
  • 2025-02-06 05:45:56.40439695 +0000 UTC m=+337027.936808948: ☑️ agreed by 3pointer.

@ti-chi-bot ti-chi-bot Bot merged commit 93470fb into pingcap:release-6.5 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants